summaryrefslogtreecommitdiff
path: root/app/[lng]/partners/(partners)/swp-document-upload/vendor-document-page.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'app/[lng]/partners/(partners)/swp-document-upload/vendor-document-page.tsx')
-rw-r--r--app/[lng]/partners/(partners)/swp-document-upload/vendor-document-page.tsx22
1 files changed, 9 insertions, 13 deletions
diff --git a/app/[lng]/partners/(partners)/swp-document-upload/vendor-document-page.tsx b/app/[lng]/partners/(partners)/swp-document-upload/vendor-document-page.tsx
index f2469c29..2431259d 100644
--- a/app/[lng]/partners/(partners)/swp-document-upload/vendor-document-page.tsx
+++ b/app/[lng]/partners/(partners)/swp-document-upload/vendor-document-page.tsx
@@ -12,9 +12,8 @@ import {
fetchVendorDocuments,
fetchVendorProjects,
fetchVendorSwpStats,
- type SwpTableFilters,
- type SwpDocumentWithStats,
} from "@/lib/swp/vendor-actions";
+import { type SwpTableFilters, type SwpDocumentWithStats } from "@/lib/swp/actions";
interface VendorDocumentPageProps {
searchParams: { [key: string]: string | string[] | undefined };
@@ -91,9 +90,8 @@ export default function VendorDocumentPage({ searchParams }: VendorDocumentPageP
} catch (err) {
console.error("초기 데이터 로드 실패:", err);
setError(err instanceof Error ? err.message : "데이터 로드 실패");
- } finally {
- setIsLoading(false);
}
+ setIsLoading(false); // finally 대신 여기서 호출
};
const loadDocuments = async () => {
@@ -152,16 +150,16 @@ export default function VendorDocumentPage({ searchParams }: VendorDocumentPageP
);
}
- if (error) {
- return (
- <Alert variant="destructive">
- <AlertDescription>{error}</AlertDescription>
- </Alert>
- );
- }
return (
<div className="space-y-6">
+ {/* 에러 메시지 */}
+ {error && (
+ <Alert variant="destructive">
+ <AlertDescription>{error}</AlertDescription>
+ </Alert>
+ )}
+
{/* 통계 카드 */}
<div className="grid grid-cols-1 md:grid-cols-4 gap-4">
<Card>
@@ -209,7 +207,6 @@ export default function VendorDocumentPage({ searchParams }: VendorDocumentPageP
filters={filters}
onFiltersChange={handleFiltersChange}
projects={projects}
- mode="vendor"
/>
</CardHeader>
<CardContent>
@@ -220,7 +217,6 @@ export default function VendorDocumentPage({ searchParams }: VendorDocumentPageP
pageSize={pageSize}
totalPages={totalPages}
onPageChange={handlePageChange}
- mode="vendor"
/>
</CardContent>
</Card>